package web

import "ksd-social-api/modules/user/model/context"

/**
 * 我的小册
 * @author feige
 * @date 2023-12-14
 * @version 1.0
 * @desc
 */
func (web *UserCenterController) FindMyNotePage() {
	userCenterContext := context.UserCenterContext{}
	web.BindJSON(&userCenterContext)
	userCenterContext.UserId = web.GetUserId()
	userCenterContext.SystemId = web.GetSystemId()
	p := userCenterService.FindMyNotePage(userCenterContext)
	web.Ok(p)
}

/**
 * 收藏小册
 * @author feige
 * @date 2023-12-14
 * @version 1.0
 * @desc
 */
func (web *UserCenterController) FindNoteUserFavPage() {
	userCenterContext := context.UserCenterContext{}
	web.BindJSON(&userCenterContext)
	userCenterContext.UserId = web.GetUserId()
	userCenterContext.SystemId = web.GetSystemId()
	p := userCenterService.FindNoteUserFavPage(userCenterContext)
	web.Ok(p)
}

/**
 * 点赞小册
 * @author feige
 * @date 2023-12-14
 * @version 1.0
 * @desc
 */
func (web *UserCenterController) FindNoteUserLikePage() {
	userCenterContext := context.UserCenterContext{}
	web.BindJSON(&userCenterContext)
	userCenterContext.UserId = web.GetUserId()
	userCenterContext.SystemId = web.GetSystemId()
	p := userCenterService.FindNoteUserLikePage(userCenterContext)
	web.Ok(p)
}

/**
 * 足迹小册
 * @author feige
 * @date 2023-12-14
 * @version 1.0
 * @desc
 */
func (web *UserCenterController) FindMyNotesBroswerPage() {
	userCenterContext := context.UserCenterContext{}
	web.BindJSON(&userCenterContext)
	userCenterContext.UserId = web.GetUserId()
	userCenterContext.SystemId = web.GetSystemId()
	p := userCenterService.FindMyNoteBroswerPage(userCenterContext)
	web.Ok(p)
}

/**
 * 取消小册收藏
 * @author feige
 * @date 2024-01-13
 * @version 1.0
 * @desc
 */
func (web *UserCenterController) CancelFavNote() {
	courseId, _ := web.GetUint64("id")
	web.Ok(userCenterService.CancelFavNote(web.GetUserId(), courseId, web.GetSystemId()))
}

/**
 * 取消小册点赞
 * @author feige
 * @date 2024-01-13
 * @version 1.0
 * @desc
 */
func (web *UserCenterController) CanceLikeNote() {
	courseId, _ := web.GetUint64("id")
	web.Ok(userCenterService.CanceLikeNote(web.GetUserId(), courseId, web.GetSystemId()))
}

/**
 * 删除小册浏览记录
 * @author feige
 * @date 2024-01-13
 * @version 1.0
 * @desc
 */
func (web *UserCenterController) RemoveNoteHits() {
	courseId, _ := web.GetUint64("id")
	web.Ok(userCenterService.RemoveNoteHits(web.GetUserId(), courseId, web.GetSystemId()))
}
